﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SalesmanForm.aspx.cs" Inherits="KPIReport.Web.Forms.Administration.Catalog.SalesmanForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server" id="Head1">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <link type="text/css" rel="stylesheet" href="<%= ResolveUrl("~/styles/ui.jqgrid.css") %>" />
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/i18n/grid.locale-id.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/jquery.jqGrid.min.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/jquery.fmatter.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/helper.js") %>"></script>
     <div style="height: 320px; overflow: auto">
    <table id="tblUser" class="scroll" cellpadding="0" cellspacing="0">
    </table>
    <div id="pgrUser" class="scroll">
    </div>
    </div>
    <br />
    <button id="btnSave" type="button">
        Simpan</button>
    <button id="btnClose" type="button">
        Tutup</button>
    <script type="text/javascript">

        $("#btnSave").button({ icons: { primary: "ui-icon-disk"} });
        $("#btnClose").button({ icons: { primary: "ui-icon-close"} });
 
    </script>
    <script type="text/javascript">

        var handlerUrl = '<%= ResolveUrl("~/ajaxhandler/administration/catalog/TransaksiHdrHandler.ashx") %>';

        $('#tblUser').jqGrid({
            url: handlerUrl + '?method=getdata',
            datatype: 'json',
            colNames: ['Salesman Code', 'Salesman Name'],
            colModel: [
                { name: 'Salesman_Code', hidden: false, index: '[Salesman Code]', width: 100 },
           		{ name: 'Salesman_Name', index: '[Salesman Name]', width: 300 }
           	],
            rowNum: 10,
            id: '[Salesman Name]',
            multiselect: true,
            rowList: [5, 10, 15, 20],
            pager: '#pgrUser',
            sortname: '[Salesman Name]',
            sortorder: "asc",
            viewrecords: true,
            jsonReader: { repeatitems: false },
            width: 500,
            height: '100%',
            caption: 'Product',
            gridview: true,
            rownumbers: true,
            ajaxGridOptions: { cache: false }
            
        });

        function ClickSave() {
            alert("a");
            alert(parent.$("#txtSalesman").val());
            parent.$("#txtSalesman").val("123");
            parent.$('#dialog').dialog('close');

        }


        $('#btnSave').click(function () {

            ClickSave();
            return false;
        });


        $('#btnClose').click(function () {
            parent.$('#dialog').dialog('close');

            return false;
        });
    
    </script>
    </form>
</body>
</html>
